﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using EnvironmentManagerSystem.BLL;
using EnvironmentManagerSystem.MODE;

namespace EnvironmentManagerSystem.HuanTongRoleManage
{
    public partial class RoleAdd : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (txtRoleName.Text.Trim() == string.Empty)
            {
                Jscript.Alert("角色名称不能为空！", this);
                return;
            }
            if (Role.AddRoles(txtRoleName.Text.Trim()))
            {
                Response.Write("<script>alert('添加成功');window.parent.art.dialog.list['添加角色'].close();</script>");
            }
            else
                Jscript.Alert("添加失败！", this);

        }

        protected void btnCancel_Click(object sender, EventArgs e)
        {
            Response.Write("<script>window.parent.art.dialog.list['添加角色'].close();</script>");
        }
    }
}
